package com.dingup.api.bean;

/**
 * Created by wancheng on 2018/7/28.
 */
public class ResponseData {

    private Integer code = 200;

    private String message = "%s is ok";

    private Boolean success = true;

    private Object result = null;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = String.format(this.message,message);
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public ResponseData(Object data) {
        this.result = data;
    }

    public ResponseData(String message, Object result) {
        setMessage(message);
        this.result = result;
    }
}
